package com.backend.modules.notification.enums;

import java.util.Arrays;
import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum NotificationType {
    // 教师通知
    NEW_SUBMISSION("新提交通知", NotificationGroup.TEACHER),
    SUBMISSION_REMINDER("提交提醒通知", NotificationGroup.TEACHER),
    
    // 学生通知
    NEW_TASK("新任务通知", NotificationGroup.STUDENT),
    TASK_UPDATE("任务更新通知", NotificationGroup.STUDENT),
    DEADLINE_REMINDER("截止日期提醒", NotificationGroup.STUDENT),
    SUBMISSION_SUCCESS("提交成功通知", NotificationGroup.STUDENT),
    SUBMISSION_APPROVED("提交审核通过通知", NotificationGroup.STUDENT),
    SUBMISSION_REJECTED("提交审核不通过通知", NotificationGroup.STUDENT);
    
    private final String description;
    private final NotificationGroup group;
    
    /**
     * 获取指定分组的通知类型列表
     */
    public static NotificationType[] getTypesByGroup(NotificationGroup group) {
        return Arrays.stream(values())
                .filter(type -> type.getGroup() == group)
                .toArray(NotificationType[]::new);
    }
} 